package com.pmcc.core.repository;
import com.pmcc.core.entity.security.Employee;
import com.pmcc.core.entity.security.Organization;
import org.aspectj.weaver.ast.Or;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.data.jpa.repository.JpaRepository;

import java.util.List;

/**
 * Created by Tomas on 2018/4/9.
 */
public interface OrganizationRepository extends JpaRepository<Organization, String> {
    Organization findByIdAndDelFlag(String id,Integer delFlag);
    Page<Organization> findAll(Specification<Organization> spec, Pageable var1);
    List<Organization> findAll(Specification<Organization> spec);
    Organization findById(String id);
    List<Organization> findByParentIdAndDelFlagOrderByCodeAsc(String parentId,Integer delFlag);
    List<Organization> findByParentIdAndDelFlag(String parentId,Integer delFlag);
    List<Organization> findByParentIdAndCodeAndDelFlag(String parentId,String code,Integer delFlag);
    List<Organization> findByCodeAndDelFlag(String code,Integer delFlag);
    List<Organization> findByDelFlag(Integer delFlag);
}

